#ifndef X3B_H
#define X3B_H

#include "common.h"

#include <string>

// List of SI models
template <AllegroVersion version>
struct x3B
{
    uint16_t t;
    uint16_t subtype;

    uint32_t len;
    char name[128];
    char type[32];
    uint32_t un1;
    uint32_t un2;
#if __cplusplus >= 202002L
    COND_FIELD(version >= A_172, uint32_t, un3);
#endif
    uint32_t TAIL;
    operator x3B<A_174>() const;
    static constexpr AllegroVersion versions[1] = {A_172};

    std::string model_str;
};

#if __cplusplus < 202002L
template <> struct x3B<A_172>
{
    uint16_t t;
    uint16_t subtype;

    uint32_t len;
    char name[128];
    char type[32];
    uint32_t un1;
    uint32_t un2;
    uint32_t un3;

    uint32_t TAIL;
    operator x3B<A_174>() const;
    static constexpr AllegroVersion versions[1] = {A_172};

    std::string model_str;
};
template <> struct x3B<A_174> : x3B<A_172> {};
#endif

#endif // X3B_H
